package com.xmtlxx.tms.mapper;

import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.xmtlxx.tms.domain.Order;
import com.xmtlxx.tms.domain.bo.OrderBo;
import com.xmtlxx.tms.domain.vo.OrderVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 订单Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-15
 */
public interface OrderMapper extends BaseMapperPlus<OrderMapper, Order, OrderVo> {
    /**
     * 根据条件分页查询订单
     *
     * @param order 订单
     * @return Page Order
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "o.create_by"),
//        @DataColumn(key = "deptName", value = "o.carrier_dept_id"),
        @DataColumn(key = "userName", value = "o.create_by")
    })
    Page<OrderVo> selectPageOrderList(@Param("page") Page<Order> page,@Param("order") OrderBo order);

    /**
     * 查询订单列表
     *
     * @param order 订单
     * @return 订单集合
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "o.create_by"),
//        @DataColumn(key = "deptName", value = "o.carrier_dept_id"),
        @DataColumn(key = "userName", value = "o.create_by")
    })
    List<OrderVo> selectOrderList(@Param("order") OrderBo order);

    List<OrderVo> selectOrder(@Param("order") OrderBo order);

    OrderVo selectOrderVoByID(String id);

    List<OrderVo> orderStatistics();

    List<OrderVo> selectOrderByFid(String fid);

    List<OrderVo> selectOrderNotInDtl();

    Order selectOrderByID(String taskId);

    int updateOrder(@Param("order") Order order);

    void removeOrder(String id);
}
